package com.yupi.ojbackend.judge.codesandbox.impl;

import com.yupi.ojbackend.judge.codesandbox.CodeSandbox;
import com.yupi.ojbackend.judge.codesandbox.model.ExecuteCodeRequest;
import com.yupi.ojbackend.judge.codesandbox.model.ExecuteCodeResponce;
import com.yupi.ojbackend.judge.codesandbox.model.JudgeInfo;
import com.yupi.ojbackend.model.enums.JudgeInfoMessageEnum;
import com.yupi.ojbackend.model.enums.QuestionSubmitStatusEnum;


public class ExampleCodeSandbox implements CodeSandbox {
    @Override
    public ExecuteCodeResponce executeCode(ExecuteCodeRequest executeCodeRequest) {
        ExecuteCodeResponce executeCodeResponce = new ExecuteCodeResponce();
        executeCodeResponce.setOutputList(executeCodeRequest.getInputList());
        executeCodeResponce.setMessage("测试执行成功");
        executeCodeResponce.setStatus(QuestionSubmitStatusEnum.SUCCESS.getText());

        JudgeInfo judgeInfo = new JudgeInfo();
        judgeInfo.setMessage(JudgeInfoMessageEnum.ACCPETED.getValue());
        judgeInfo.setTime(100);
        judgeInfo.setMemory(100);
        executeCodeResponce.setJudgeInfo(judgeInfo);
        
        return executeCodeResponce;
    }
}
